package com.zj.osm.view.project.projectdetail;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.zj.osm.R;
import com.zj.osm.view.BaseActivity;
import com.zj.osm.view.project.projectdetail.fragment.BasisFragment;
import com.zj.utils.utils.utilcode.KeyboardUtils;

import static com.zj.osm.utils.Configuration.PROJECT_ID;


/**
 * 项目详情活动，包含四个fragment
 */
public class ProjectDetailActivity extends BaseActivity {

    public static Long PROJECT_DETAILS_ID;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_details);
        KeyboardUtils.fixAndroidBug5497(this);
        initData();
        initView();
    }

    private void initData() {
        PROJECT_DETAILS_ID = getBundle(getIntent()).getLong(PROJECT_ID);
    }

    private void initView() {
        changeFragment(new BasisFragment());
    }

    private void changeFragment(Fragment fragment) {
        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        transaction.replace(R.id.de_content, fragment);
        transaction.commit();
    }

}
